﻿/**
*预约贷款
*/
Chenxin.UI.ApplyLoanForm = Chenxin.extend(Chenxin.UI.FormCommon,{
    actionUrl:'/service/logic/ShowListPreliminary.ashx',
    id:'AppLoan',
    renderTo:'divAppLoan',
    winCls:'',
    jqmWidth:650,
    defBBtn:true,
    createForm: function() {
        return Chenxin.FormCommon.ApplyLoanForm(this.id);
    },
//	initFormValidator:function(){
//         //贷款日期
//         $("#LoanDate").formValidator({
//            validatorgroup: this.id,
//            onshow: "请输入贷款时间！",
//            onfocus: "贷款时间格式：YYYY-MM-DD HH:mm",
//            oncorrect: " "
//        }).inputValidator({ 
//            min: 1,
//            empty: {
//                leftempty: false,
//                rightempty: false,
//                emptyerror: "贷款时间不能为空！"
//            },
//            onerror: "贷款时间不能为空！"
//        });
//    },
    initEvent: function() {
		/*************事件：贷款时间得到焦点*************/
        $("#LoanApplyDate").focus(function(){
            WdatePicker({
                dateFmt:'yyyy-MM-dd HH:mm',
                oncleared:function(){
                            $(this).blur();
                          },
                onpicked:function(){
                            $(this).blur();
                         }
            });
        });
    },
    createComboList:function(){
        //签约地点
        var ComboOrderPlace = new Chenxin.UI.Combo({
            containerId: '#divOrderPlace',
            name: 'OrderPlace',
            required:true,
            tbxWidth: 105,
            colWidth: 105,
            items: comboCommon.OrderPlace
        });
        return [ComboOrderPlace];
    },
    
    initFormValidator:function(){
        //贷款时间
        $("#LoanApplyDate").formValidator({
            validatorgroup: this.id,
            onshow: "请输入贷款时间！",
            onfocus: "贷款时间格式：YYYY-MM-DD HH:mm",
            oncorrect: " "
        }).inputValidator({ 
            min: 1,
            empty: {
                leftempty: false,
                rightempty: false,
                emptyerror: "贷款时间不能为空！"
            },
            onerror: "贷款时间不能为空！"
        });
    },
    saveSucc: function() {
        this.reloadGrid();
    },
    initComponent: function() {
        Chenxin.UI.ApplyLoanForm.superclass.initComponent.call(this);
    }
});

Chenxin.FormCommon.ApplyLoanForm=function(formID){
return '<table class="tbl_f"><tr><th style="width:105px; height:26px;">房源编号：</th><td><input name="HouseCode" class="inputbox_n fl" type="text" readonly="readonly" style="width:160px;"/></td></tr><tr><th>房源地址：</th><td><input name="Address" class="inputbox_n fl" type="text" disabled="disabled" style="width:160px;"/></td></tr><tr><th>贷款日期：</th><td><input type="text" id="LoanApplyDate" name="LoanApplyDate" class="inputbox_n fl" style="width:151px" /><div id="LoanApplyDateTip" style="float: left; margin-left: 5px; height: 26px; line-height: 26px; text-align: left;" class="fl"></div></td></tr><tr><th>签约地点：</th><td><div id="divOrderPlace"style="z-index:1; margin-right: 2px;" class="SelectWrapSingle"></div></td></tr><tr><td colspan="2" ><input type="hidden"  name="RecordId" /></td></tr></table>';
};